package lab02.test19;

public class Test {
    public static void main(String[] args) {
        //19、 	编写一个程序，实现字符串的大小写转换
        // 并倒序输出，如输入为“HelloWord”，输出为“DROwOLLEH”。
        StringBuffer stringBuffer = new StringBuffer();

        String result = "HelloWord";

        for (int i = 0; i < result.length(); i++) {
            char chars = result.charAt(result.length() - i - 1);

            if (chars >= 'A' && chars <= 'Z') {
                stringBuffer.append((char) (chars + 32));
            } else if (chars >= 'a' && chars <= 'z') {
                stringBuffer.append((char) (chars - 32));
            }
        }
        System.out.println(stringBuffer.toString());

    }
}
